using Proto;

namespace sgf.server
{
    public interface IOnRestart;

    public interface IOnRestartSystem : ISystemType
    {
        Task Run(IBusActor busActor, IContext context);
    }

    public abstract class OnRestartSystem<T> : IOnRestartSystem where T : IOnRestart
    {
        public async Task Run(IBusActor busActor, IContext context)
        {
            await this.OnRestart((T)busActor,context);
        }

        public abstract Task OnRestart(T busActor, IContext context);

        public Type Type()
        {
            return typeof(T);
        }
    }
}